use crate::dao;
use crate::models::models::components::v2ray::server::ComponentV2rayServer;
use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_component_v2ray_servers() -> MagicBoxResult<MagicBoxResponse<Vec<ComponentV2rayServer>>> {
    let servers = dao::components::v2ray::server::get_server_configs()?;

    Ok(MagicBoxResponse::new_success(servers))
}